<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-model双向数据绑定</title>
    <script src="../../js/vue3.js"></script>
    <style>
        #app {
            margin: 2rem auto;
            width: 50%;
            text-align: center;
        }
        
        p {
            font-size: 1.5rem;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div id="app">
        <p>{{str}}</p>
        <p><input type="text" v-model="str" /></p>
        <p>{{text}}</p>
        <p><textarea v-model="text"></textarea></p>
        <p><input type="checkbox" value="睡觉" v-model="checked">睡觉</p>
        <p><input type="checkbox" value="吃饭" v-model="checked">吃饭</p>
        <p><input type="checkbox" value="玩游戏" v-model="checked">玩游戏</p>
        <p>{{checked}}</p>
    </div>
    <script>
        const v_app = Vue.createApp({
            data() {
                return {
                    str: "start",
                    text: "123",
                    checked: ['爱好:']
                }
            }
        });
        v_app.mount("#app");
    </script>
</body>

</html>